# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-liquid
_gemname=liquid
# NOTE: Before bumping, check version required by jekyll.
pkgver=4.0.4
pkgrel=1
pkgdesc="A secure, non-evaling end user template engine with aesthetic markup"
url="https://shopify.github.io/liquid/"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-minitest ruby-rake"
source="https://github.com/Shopify/liquid/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	tests-disable-stack-profiler.patch
	tests-disable-liquid-c.patch
	gemspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions
}

sha512sums="
8c7a674ea7f7542f3a57e57235f1252d1177794fe2108463d29fb91efec68ac6e3cc2df5efe865afa47b34dbfce5bb4326d9cd661786429e8985b320671c6d23  ruby-liquid-4.0.4.tar.gz
663cae2fa51a388fa2cfc2ba08827e38df2db1e0dd34b2fe932c098c632ea8161474138e472dd8d6d9a0ac9d30a5c77625c433b462e109a70b947412fd27b328  tests-disable-stack-profiler.patch
c4cee2d4ae636712d42ac14c4f12794eae754cc7c4075fb726a214db25352ae4142e90dff3c3c9d148935462ef9faa78dd76c58a21a3c0d32ead9b34098c942d  tests-disable-liquid-c.patch
aececff77a9d267e30573449734a6f21986c1860481e1d91b862727106e39df199698ef46a18196cab515f39842635e5ae0b732c3655da98a988e91a769b2d89  gemspec.patch
"
